import { request } from '../../../request';

// 获取菜单树
export function getMenuTableList(params: MenuPageListApi.MenuTableListParams) {
  params.sysType = 'cdl';
  return request<MenuPageListApi.MenuList>({ url: '/system/menu/list', params });
}

// 新增菜单
export function addMenu(data: any) {
  data.sysType = 'cdl';
  return request({
    url: '/system/menu',
    method: 'post',
    data
  });
}

// 修改菜单
export function updateMenu(data: any) {
  data.sysType = 'cdl';
  return request({
    url: '/system/menu',
    method: 'put',
    data
  });
}

// 删除菜单
export function delMenu(menuId: number) {
  return request({
    url: `/system/menu/${menuId}`,
    method: 'delete'
  });
}
